﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace FOChangeDoc
{
	[Serializable]
	public partial class FOChangeDocModel : UIModel
	{
		#region Constructor
		public FOChangeDocModel() : base("FOChangeDoc")
		{
			InitClass();
			this.SetResourceInfo("ae0f8b05-08c8-4187-9ff0-11d516dfe0f4");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private FOChangeDocModel(bool isInit) : base("FOChangeDoc")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new FOChangeDocModel(false);
		}
		#endregion
		#region member
		#region views
		private cRefView viewcRef;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public cRefView cRef
		{
			get { return (cRefView)this["cRef"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewcRef = new cRefView(this);
			this.viewcRef.SetResourceInfo("33ee0f07-26f1-42ba-a931-8ace02cf3548");
			this.Views.Add(this.viewcRef);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class cRefView : UIView
	{
		#region Constructor
		public cRefView(IUIModel model) : base(model,"cRef","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.FOChangeBE.FOChangeDoc", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private cRefView():base(null,"cRef","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.FOChangeBE.FOChangeDoc", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new cRefView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldDocNo
		{
			get { return this.Fields["DocNo"]; }
		}
		public IUIField FieldBusinessDate
		{
			get { return this.Fields["BusinessDate"]; }
		}
		public IUIField FieldStatus
		{
			get { return this.Fields["Status"]; }
		}
		public IUIField FieldFODocNo
		{
			get { return this.Fields["FODocNo"]; }
		}
		public IUIField FieldRemake
		{
			get { return this.Fields["Remake"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public cRefDefaultFilterFilter DefaultFilter
		{
			get { return (cRefDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","7511d790-e505-47bb-adb9-61d15f5919f5");
			UIModelRuntimeFactory.AddNewUIField(this,"DocNo", typeof(String), false,"","System.String", "DocNo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","22b0b31b-ce39-490a-b070-59ac34c56b09");
			UIModelRuntimeFactory.AddNewUIField(this,"BusinessDate", typeof(DateTime), false,"","System.Date", "BusinessDate", true,true, false, "",false,(UIFieldType)1,"c9e6bc50-2e39-4f27-9519-da0c7859d37e","243ba718-2cb3-4922-950c-d986439d39a0");
			UIModelRuntimeFactory.AddNewUIField(this,"Status", typeof(Int32), true,"","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.FOChangeBE.FOChangeDocStatusEnum", "Status", true,true, false, "",false,(UIFieldType)2,"4544de3a-40fc-4772-a85b-5830e480e128","a6e2bbeb-8788-4b32-8756-06cfd8e67ff0");
			UIModelRuntimeFactory.AddNewUIField(this,"FODocNo", typeof(String), true,"","System.String", "FODocNo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","faab03e6-aebc-4f35-a758-f538624cb032");
			UIModelRuntimeFactory.AddNewUIField(this,"Remake", typeof(String), true,"","System.String", "Remake", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","c4686789-5bad-48ab-a179-eb4f41d3ac9e");


			this.CurrentFilter = new cRefDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region new method
		public new cRefRecord FocusedRecord
		{
			get { return (cRefRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new cRefRecord AddNewUIRecord()
		{	
			return (cRefRecord)base.AddNewUIRecord();
		}
		public new cRefRecord NewUIRecord()
		{	
			return (cRefRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class cRefRecord : UIRecord
	{
		#region Constructor
		public cRefRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private cRefView uiviewcRef
		{
			get { return (cRefView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldID);
			}
			set{
				this[this.uiviewcRef.FieldID] = value;
			}
		}
		
		
		public  String DocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldDocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldDocNo);
			}
			set{
				this[this.uiviewcRef.FieldDocNo] = value;
			}
		}
		
		
		public  DateTime BusinessDate
		{
			get{
				//object value = this[this.uiviewcRef.FieldBusinessDate] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewcRef.FieldBusinessDate);
			}
			set{
				this[this.uiviewcRef.FieldBusinessDate] = value;
			}
		}
		
		
		public  Int32? Status
		{
			get{
				//object value = this[this.uiviewcRef.FieldStatus] ;
				//return (Int32?)value;
				return GetValue<Int32?>(this.uiviewcRef.FieldStatus);
			}
			set{
				this[this.uiviewcRef.FieldStatus] = value;
			}
		}
		
		
		public  String FODocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldFODocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldFODocNo);
			}
			set{
				this[this.uiviewcRef.FieldFODocNo] = value;
			}
		}
		
		
		public  String Remake
		{
			get{
				//object value = this[this.uiviewcRef.FieldRemake] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldRemake);
			}
			set{
				this[this.uiviewcRef.FieldRemake] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class cRefDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public cRefDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"Org.ID='#Context.OrgID#'
",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private cRefDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new cRefDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}